package com.haitaoit.chengquan.utils;

import android.content.Context;
import android.view.View;
import android.widget.Toast;

import com.haitaoit.chengquan.base.ExitApplication;

public class ToastUtils {
    Context context;
    public  ToastUtils (Context context){
        this.context=context;
    }
    public void toast(int msgId){
        Toast.makeText(context, msgId, Toast.LENGTH_SHORT).show();
    }
    public void toast(String  msg){
        Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
    }

    public static void toastLong(Context context, String content) {
        Toast.makeText(context, content, Toast.LENGTH_LONG).show();
    }

    public static void toastshort(Context context, String content) {
        Toast.makeText(context, content, Toast.LENGTH_SHORT).show();
    }

    public static void toastLong(Context context, int msgId) {
        Toast.makeText(context, msgId, Toast.LENGTH_LONG).show();
    }

    public static void toastshort(Context context, int msgId) {
        Toast.makeText(context, msgId, Toast.LENGTH_SHORT).show();
    }


    public static void toastshort(Context context, View view) {
//		Toast.makeText(context, content, Toast.LENGTH_SHORT).show();
    }
    private static Toast toast;
    public static void showToast(String text){
        if (toast==null){
            toast = Toast.makeText(ExitApplication.context, text, Toast.LENGTH_LONG);
        }else {
            toast.setText(text);
        }
        toast.show();
    }
}
